package org.zw.android.framework.http;


/**
 * 
 * @author zhouwei
 *
 */
public abstract class BaseFilter implements FilterResponse {

	private HttpRequest 		mRequset ;
	private ResponseBean		mHttpBean ;
	private HttpUIHandler 		mHandler ;
	
	protected final void attachObject(HttpRequest req,ResponseBean bean){
		mRequset	= req ;
		mHttpBean	= bean ;
	}
	
	void attachUiHandler(HttpUIHandler handler){
		mHandler	= handler ;
	}
	
	public final HttpRequest getRequset() {
		return mRequset;
	}
	
	public final ResponseBean getResponseBean() {
		return mHttpBean;
	}
	
	public HttpUIHandler getHandler(){
		return mHandler ;
	}
	
	public void sendMessage(int what){
		if(mHandler != null){
			mHandler.sendMessage(what);
		}
	}
	
	public void sendMessage(int what,Object obj){
		if(mHandler != null){
			mHandler.sendMessage(what, obj);
		}
	}
	
	public void sendMessage(int what, int arg0, int arg1){
		if(mHandler != null){
			mHandler.sendMessage(what, arg0, arg1);
		}
	}
	
	public void sendErrorMessage(Object obj){
		if(mHandler != null){
			mHandler.sendErrorMessage(obj);
		}
	}
}
